﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using HZ.Supervise.IBLL;
using HZ.Supervise.Model;

namespace HZ.Supervise.Web.Secondphase.ReportHospital
{
    public partial class HospitalAmountSubsidyShow : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
              
                banding();
            }
        }
        //绑定未补助的医院
        private void banding()
        {
            string strstartime = "", strendtime = "", strHostpitalid = "", strAoumont = "";
            strstartime = Request.QueryString["id3"].ToString();
            strendtime = Request.QueryString["id4"].ToString();
            strHostpitalid = Request.QueryString["id2"].ToString();
            strAoumont = Request.QueryString["id5"].ToString();
            int totalrecord = 0;
            HZ.Supervise.IBLL.IBLL_Prescription iPrescription = HZ.Supervise.BLLFactory.IBl_Prescription();
            string strwhere = " and POrderStatus>1 and psbsidyamount='" + strAoumont + "' ";
         
            if (!strHostpitalid.Trim().Equals(""))//医院名称
            {
                strwhere += " and PHospitalId  = '" + strHostpitalid + "'";
            }
            if (!strstartime.Trim().Equals("")) //开始时间
            { strwhere += " and Paddtime >='" + (new HZ.Common.ConvertHelper(strstartime.Trim()).ToDateTime).Value.ToString() + "'"; }
            if (!strendtime.Trim().Equals("")) //结束时间
            { strwhere += " and Paddtime <='" + (new HZ.Common.ConvertHelper(strendtime.Trim()).ToDateTime).Value.ToString() + "'"; }
            DataTable dt = iPrescription.GetHospitalePrescripdeail(strwhere, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, out totalrecord);
            AspNetPager1.RecordCount = totalrecord;
            this.gvwDetail.DataSource = dt;
            this.gvwDetail.DataBind();


        }
       
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            banding();
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            banding();
        }

    }
}
